import masterDataAxios from '@/libs/masterDataAxios'
const APIGroup = {
	marsterDataV1: 'MasterData/v1',
	marsterData: 'MasterData/sync',
	mrsterData2: 'MasterData2/v1'
}

export const login = ({ userName, password }) => {
	const data = {
		userName,
		password
	}
	return masterDataAxios.request({
		url: 'login',
		data,
		method: 'post'
	})
}

export const getUserInfo = () => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/EmployeeService/PSAGetLoginEmployee`,
		method: 'post'
	})
}

export const getMenuListForUser = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/AccountService/GetAuthMenu`,
		data: info,
		method: 'post'
	})
}
export const getAuthFunction = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/AccountService/GetAuthFunction`,
		data: info,
		method: 'post'
	})
}
export const logout = () => {
	return masterDataAxios.request({
		url: 'logout',
		method: 'post'
	})
}

export const EmployeeSelector = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.marsterDataV1}/Employee/EmployeeSelector`,
		data: info,
		method: 'post'
	})
}
export const OrganizationSelector = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/OrganizationService/OrganizationSelector`,
		data: info,
		method: 'post'
	})
}
export const GetOrg = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/OrganizationService/GetOrg`,
		data: info,
		method: 'post'
	})
}
export const GetOrgTree = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/OrganizationService/GetOrgTree`,
		data: info,
		method: 'post'
	})
}
export const SyncOne = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.marsterData}/Account/SyncOne`,
		data: info,
		method: 'post'
	})
}
export const EmpSelector = (info) => {
	return masterDataAxios.request({
		url: `${APIGroup.mrsterData2}/MasterData/EmployeeService/PSAEmployeeSelector`,
		data: info,
		method: 'post'
	})
}
